package com.member.common.enums;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum StatusEnum {

    DISABLE(0, "上架"),
    ENABLE( 1, "下架"),
    ;

    private final Integer key;
    private final String desc;

    StatusEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static StatusEnum getByKey(Integer _key){
        for (StatusEnum item : StatusEnum.values()){
            if(Objects.equals(item.getKey(), _key)){
                return item;
            }
        }
        return null;
    }

}
